package cn.e4j.core.util;

import com.baomidou.dynamic.datasource.toolkit.CryptoUtils;

public class EncodeDbPwd {

    public static void main(String[] args) throws Exception {

        String password = "dcms00:";

        String encodePassword = CryptoUtils.encrypt(password);
        System.out.println("加密："+encodePassword);
        String decodePassword = CryptoUtils.decrypt(encodePassword);
        System.out.println("解密："+decodePassword);

        //自定义publicKey
        String[] arr = CryptoUtils.genKeyPair(512);
        System.out.println("privateKey:" + arr[0]);
        System.out.println("publicKey:" + arr[1]);
        System.out.println("password:" + CryptoUtils.encrypt(arr[0], password));
    }
}
